package com.basker.pisces.concurrent.counter;

import java.util.concurrent.atomic.AtomicInteger;

public class LocalCounter extends AbstractCounter {

    private final AtomicInteger counter = new AtomicInteger(0);

    public LocalCounter(String key) {
        super(key);
    }

    @Override
    public int decrementAndGet() {
        return counter.decrementAndGet();
    }

    @Override
    public int get() {
        return counter.get();
    }

    @Override
    public int getAndDecrement() {
        return counter.getAndDecrement();
    }

    @Override
    public int getAndIncrement() {
        return counter.getAndIncrement();
    }

    @Override
    public int incrementAndGet() {
        return counter.incrementAndGet();
    }

    @Override
    public void set(int value) {
        counter.set(value);
    }

}
